package com.yztc.wl.zhibo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by wlpc on 2016/11/4.
 */
public class OnePagerAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> myFragments;
    private List<String> myFragmentTitles;

    public OnePagerAdapter(FragmentManager fm, List<Fragment> myFragments, List<String> myFragmentTitles) {
        super(fm);
        this.myFragments = myFragments;
        this.myFragmentTitles = myFragmentTitles;
    }

    @Override
    public Fragment getItem(int position) {
        return myFragments.get(position);
    }

    @Override
    public int getCount() {
        return myFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return myFragmentTitles.get(position);
    }
}
